package com.renting.modules.sys.entity;

import javax.persistence.*;

import com.renting.common.entity.LocationEntity;

import java.util.List;
import java.util.Set;

/**
 * @author administrator
 * @version 1.0 @remark：
 * @description:这个类继承自有位置信息的实体类
 * @create date： 2018年3月14日
 */
@Entity
@Table(name = "SYSTEM_USER")
public class User extends LocationEntity {

    private String nickName;
    private String avatarUrl;
    private String phone;
    private String gender;
    private String identityCard;
    private String zmScore;


    @ManyToMany(cascade = {CascadeType.PERSIST}, fetch = FetchType.EAGER)
    @JoinTable(name = "user_role", joinColumns = @JoinColumn(name = "user_id", table = "SYSTEM_USER", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "role_id", referencedColumnName = "id", table = "sys_role"))
    private Set<Role> roles;

    public User() {
        super();
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public Set<Role> getRoles() {
        return roles;
    }

    public void setRoles(Set<Role> roles) {
        this.roles = roles;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getIdentityCard() {
        return identityCard;
    }

    public void setIdentityCard(String identityCard) {
        this.identityCard = identityCard;
    }

    public String getZmScore() {
        return zmScore;
    }

    public void setZmScore(String zmScore) {
        this.zmScore = zmScore;
    }

}
